<!-- 个人市场化信用 -->
<template>
  <div class="main">
    <el-tabs type="border-card" @tab-click="HandTabClick" v-model="tabsmodel">
      <el-tab-pane label="个人市场化信用" name="1">
        <PureTableBar class="list_hei">
          <!-- <template #buttons>
            <el-button type="primary" @click="GetMarketCreditData()">
              获取数据
            </el-button>
          </template> -->
          <template v-slot="{ size, checkList }">
            <pure-table border align-whole="center" showOverflowTooltip table-layout="auto" :loading="loading"
              size="small" adaptive :data="dataList" :columns="columns" :checkList="checkList" :pagination="pagination"
              max-height="600" :header-cell-style="{
                background: 'var(--el-table-row-hover-bg-color)',
                color: 'var(--el-text-color-primary)'
              }" @size-change="handleSizeChange" @current-change="handleCurrentChange">
            </pure-table>
          </template>
        </PureTableBar>
      </el-tab-pane>
      <el-tab-pane label="个人评分模型列表" name="2">
        <PureTableBar class="list_hei">
          <template #buttons>
            <el-button type="primary" @click="NewScoringModel()">
              新建评分模型
            </el-button>
          </template>
          <template v-slot="{ size, checkList }">
            <pure-table border align-whole="center" showOverflowTooltip table-layout="auto" :loading="loading2"
              size="small" :data="dataList2" :columns="columns2" :checkList="checkList" :pagination="pagination2"
              max-height="600" :header-cell-style="{
                background: 'var(--el-table-row-hover-bg-color)',
                color: 'var(--el-text-color-primary)'
              }" @size-change="handleSizeChange2" @current-change="handleCurrentChange2">
              <template #operation="{ row }">
                <el-button type="primary" size="small" text @click="ShowDetails(row)">
                  详情
                </el-button>
              </template>
            </pure-table>
          </template>
        </PureTableBar>
      </el-tab-pane>
      <el-tab-pane label="个人信用分测算列表" name="3">
        <PureTableBar class="list_hei">
          <template #buttons>
            <el-form :model="PersonFrom" :inline="true">
              <el-form-item label="申请测算个人名称">
                <el-select v-model="PersonFrom.personalId" style="width: 190px;" clearable filterable
                  value-key="personalcreditreportId">
                  <el-option v-for="item in PersonMyName" :key="item.personalcreditreportId" :label="item.personaName"
                    :value="item" />
                </el-select>
              </el-form-item>
              <el-form-item label="模型名称">
                <el-select v-model="PersonFrom.modelId" style="width: 190px;" clearable filterable
                  value-key="personalCreditModelId">
                  <el-option v-for="item in PersonModelName" :key="item.personalCreditModelId" :label="item.modelName"
                    :value="item" />
                </el-select>
              </el-form-item>
            </el-form>
            <el-button type="primary" @click="ChangeCalculate()">
              测算
            </el-button>
          </template>
          <template v-slot="{ size, checkList }">
            <pure-table border align-whole="center" showOverflowTooltip table-layout="auto" :loading="loading3"
              size="small" :data="dataList3" :columns="columns3" :checkList="checkList" :pagination="pagination3"
              max-height="600" :header-cell-style="{
                background: 'var(--el-table-row-hover-bg-color)',
                color: 'var(--el-text-color-primary)'
              }" @size-change="handleSizeChange3" @current-change="handleCurrentChange3">
              <template #operation="{ row }">
                <el-button type="primary" text size="small" :disabled="!row.isMeasure" @click="ShowDetails3(row)">
                  详情
                </el-button>
              </template>
            </pure-table>
          </template>
        </PureTableBar>
      </el-tab-pane>
    </el-tabs>
    <new-my-mode @GetMySortsList="GetMySortsList" ref="keepmodel" />
    <mode-details ref="REFModeDetails_" :ModeDetails_="ModeDetails_" />
    <!-- 测算详情 -->
    <ScoreParticulars ref="ScoreParticulars_" />
  </div>
</template>

<script lang="ts" setup>
import ScoreParticulars from "./component/ScoreParticulars.vue";
import { PureTableBar } from "@/components/RePureTableBar";
import { IndividualMarket } from "./hook/IndividualMarketCredit"
import ModeDetails from "./component/ModeDetails.vue";
import NewMyMode from "./component/NewMyMode.vue";
const {
  dataList,
  loading,
  columns,
  tabsmodel,
  pagination,
  dataList2,
  loading2,
  columns2,
  pagination2,
  dataList3,
  loading3,
  columns3,
  keepmodel,
  pagination3,
  PersonModelName,
  PersonMyName,
  PersonFrom,
  ModeDetails_,
  REFModeDetails_,
  ScoreParticulars_,
  ShowDetails,
  ShowDetails3,
  HandTabClick,
  GetMySortsList,
  ChangeCalculate,
  NewScoringModel,
  handleSizeChange,
  handleCurrentChange,
  handleSizeChange2,
  handleCurrentChange2,
  handleSizeChange3,
  handleCurrentChange3
} = IndividualMarket()
</script>

<style lang="scss" scoped>
@import url(@/style/CreditComm.scss);
</style>
